package org.training.person.mason.entities;

import java.io.Serializable;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Blob;
import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class RelationShip implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4697115488794587024L;
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key relationId;
	@Persistent
	private String relationName;
	@Persistent
	private Blob relationPhoto;
	@Persistent
	private List<String> Descriptions;
	@Persistent
	private List<String> phones;
	@Persistent
	private List<String> celephones;
	@Persistent
	private List<String> emails;

	/**
	 * 
	 */
	public RelationShip() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param relationName
	 * @param descriptions
	 * @param phones
	 * @param celephones
	 * @param emails
	 */
	public RelationShip(String relationName, String description, String phone,
			String cellphone, String email) {
		super();
		this.relationName = relationName;
		addDescription(description);
		addPhone(phone);
		addCelephone(cellphone);
		addEmail(email);
	}

	/**
	 * @return the relationId
	 */
	public Key getRelationId() {
		return relationId;
	}

	/**
	 * @return the relationName
	 */
	public String getRelationName() {
		return relationName;
	}

	/**
	 * @param relationName
	 *            the relationName to set
	 */
	public void setRelationName(String relationName) {
		this.relationName = relationName;
	}

	/**
	 * @return the relationPhoto
	 */
	public Blob getRelationPhoto() {
		return relationPhoto;
	}

	/**
	 * @param relationPhoto
	 *            the relationPhoto to set
	 */
	public void setRelationPhoto(Blob relationPhoto) {
		this.relationPhoto = relationPhoto;
	}

	/**
	 * @return the descriptions
	 */
	public List<String> getDescriptions() {
		return Descriptions;
	}

	/**
	 * @return the phones
	 */
	public List<String> getPhones() {
		return phones;
	}

	/**
	 * @return the celephones
	 */
	public List<String> getCelephones() {
		return celephones;
	}

	/**
	 * @return the emails
	 */
	public List<String> getEmails() {
		return emails;
	}

	/**
	 * 
	 * @param desc
	 */
	public void addDescription(String desc) {
		Descriptions.add(desc);
	}

	/**
	 * 
	 * @param phone
	 */
	public void addPhone(String phone) {
		phones.add(phone);
	}

	/**
	 * 
	 * @param cellphone
	 */
	public void addCelephone(String cellphone) {
		celephones.add(cellphone);
	}

	/**
	 * 
	 * @param email
	 */
	public void addEmail(String email) {
		emails.add(email);
	}
}
